<style>
.content-group {background:#fff;border-radius: 0.5rem;margin-bottom:0.39rem}
.label-info {
	background-color:#d9f9ee;
	color:#03c274;
	padding: .2em .4em .2em;
}
.fui-list:before {
    border-top: 0 solid #D9D9D9;
}
.msg-input {
	position: relative;
}

.msg-input input {
	width: 100%;
	height: 1.65rem;
	display: block;
	border: none;
	border-radius: 1rem;
	font-family: inherit;
	color: #3d4145;
	font-size: 0.65rem;
	font-weight: normal;
	padding: 0 0.5rem;
	background-color: #f2f2f2;
}

.msg-input input::-webkit-input-placeholder {
	color: #cccccc;
	opacity: 1;
}

.msg-input i {
	position: absolute;
	font-size: 0.8rem;
	color: #b4b4b4;
	top: 0;
	right: 0.4rem;
	line-height: 1.6rem;
}

.msg-input i + input {
	padding-left: 1.4rem;
}
.page-goods-detail .seckill-container  .seckill-list2 .fui-list-inner .text.timer span {
    display: inline-block;
    background:#fb2b3b;
    color:#fff;
    width:.9rem;height:.9rem;
    border-radius: .1rem;
    line-height:.9rem;
    font-size:.5rem; 
	text-align: center;
}
.video-sms-pane {
	top:10rem;
	right:0;
}
.arrow-left {
  display:inline-block;
  width:0px;
  height:0px;
  border-bottom:5px solid transparent;  /* left arrow slant */
  border-top:5px solid transparent; /* right arrow slant */
  border-right:5px solid #ff4e2c; /* bottom, add background color here */
  font-size:0px;
  line-height:0px;
  margin-bottom:-1px
}
.page-goods-detail .fui-navbar .cartbtn {padding-right:0.3rem;background:#fff;opacity:1}
.fui-navbar .buybtn  {padding-left:0.3rem;background:#fff}
.fui-navbar .nav-item {
    color: #999;
}
.fui-navbar .nav-item .label {
    color: #999;
}
.page-goods-detail .seckill-container  .seckill-list{
    background: #fb2f30;
}
.page-goods-detail .seckill-container.isdel  .seckill-list{
    background: #c1c1c1;
}
.page-goods-detail .seckill-container  .seckill-list2 .fui-list-inner .text {
    height: 1.2rem;
}
.fui-tag-danger {
    background: #d23114;
}
.isdel .fui-tag-danger {
    background: #ababab;
}
.fui-number .minus:before, .fui-number .plus:before {
	border-left: 0 solid #d9d9d9;
}
.fui-number .minus:after, .fui-number .plus:after {
	border-right: 0 solid #d9d9d9;
}
.fui-number:before {
	border-top: 0 solid #d9d9d9;
}
.fui-number:after {border-top: 0 solid #d9d9d9;}
.fui-number .num {
	color:#666;
}
.fui-number .num {
	color:#666;
}
.fui-number.small {
	height: 1.2rem;
	width: auto;
	line-height: 1.2rem;
}
.fui-number .minus, .fui-number .plus {
	z-index:0;
}
.fui-number.small .minus{
	color: red;
	padding-top:1px;
	border: 1px solid red;
	border-radius:50%;
}
 .fui-number.small .plus {
	color: #fff;
	padding-top:1px;
	background: red;
	border: 1px solid red;
	border-radius:50%;
}
.btn01{padding:0.1rem 0.2rem;font-size:0.5rem;border: 1px dashed #ff4e2c;margin-right:-0.25rem}
.btn02{padding:0.1rem 0.2rem;font-size:0.5rem;color:#fff;background:#ff4e2c;border: 1px dashed #ff4e2c;border-radius:0.1rem;}
.setlike{padding:0.1rem 0.5rem;color:#fff;background-color:rgba(0,0,0,0.3);border-radius:1rem;}
</style>
<div ng-include="sys_html('common/_header','','','jy_weishop')"></div>
<div class="fui-page fui-page-current page-goods-detail">
	<div class="topbg" style="width:100%;height:6.8rem;background: url({{tomedia(pagedata.pluginset.o_img) || '../addons/jy_quanhuo/resource/images/topbg.png'}}) no-repeat 50%;background-size: cover;background-color:#63BE72;">
			<div class="fui-cellone">
				<div class="fui-cellone-label" style="width:auto;">
					<img style="border-radius: 0.2rem;width:2.5rem;height:2.5rem" ng-src="{{tomedia(pagedata.merch.logo) || '../addons/jy_quanhuo/resource/images/logo.png'}}" />
				</div>
				<div class="fui-cellone-text" style="font-size:0.7rem;color:#fff;padding-left:0.5rem">
					<div class="bold">{{pagedata.merch.merchname || '商户名称'}} </div>
					<div style="font-size:0.6rem">{{pagedata.merch.gamenum || 0}}个活动 | {{pagedata.merch.likes || 0}}人关注</div>
					<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{}}</div>
					<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">金牌会员</div>
				</div>
				<div class="fui-cellone-remark noremark">
					<div class="setlike" href="javascript:;" ng-click="pagedata.setlike();toogle(pagedata,'islike')">
					<i ng-class="{'icon':1,'icon-follow':pagedata.islike !=1,'icon-xiai':pagedata.islike >0}" style="font-size:0.7rem"></i>
					{{pagedata.islike!=1?'关注':'已关注'}}</div>
				</div>
			</div>
	</div>
	<div class="fui-content" style="background:none;top:0;">
		<div style="padding:0.5rem;margin-top:-2.8rem">
			<div class="pic">
				<img class="radiustop" ng-src="{{tomedia(pagedata.item.logo) || '../core/resource/images/nopic.jpg'}}" style="display: block; width: 100%; height: 10rem;">
			</div>
			<!--拼团-->
			<div ng-class="{'seckill-container':1,'isdel':pagedata.item.status==2}">
				<div class="fui-list seckill-list" style="padding:0.5rem">
					<div ng-if="pagedata.item.isdiygoods==1" class="fui-list-media">
						<div class="fui-tag fui-tag-danger bold" style="padding:0.3rem 0.4rem;">
								<div>限时</div>
								<div style="padding-top:0.3rem">{{pagedata.item.unitname || '活动'}}</div>
						</div>
					</div>
					<div ng-if="pagedata.item.isdiygoods==1" class="fui-list-inner" style="color:#fff;">
						￥<span class="bigprice bold" style="font-size:1.5rem">{{pagedata.item.price||'0.00'}}</span>
					</div>
					<div ng-if="pagedata.item.isdiyform==1" class="fui-list-inner" style="color:#fff;">
						{{pagedata.item.typename || '活动'}}
					</div>
				</div>
				<div ng-if="pagedata.item.status!=2" class="fui-list seckill-list2" style="background:#ffeeda;width:6rem;">
					<div class="fui-list-inner">
						<div class="text">距结束还剩:</div>
						<div class="text timer" style="height:auto;font-size:0.5rem" ng-init="tool.time_down(pagedata.item.rest_time)">
							<span class="time-day" style="width:.9rem;padding-right:0.1rem">{{pagedata.item.rest_time.day}}</span> 天
							<span class="time-hour">{{pagedata.item.rest_time.hour}}</span> :
							<span class="time-min">{{pagedata.item.rest_time.minute}}</span> :
							<span class="time-sec">{{pagedata.item.rest_time.second}}</span>
						</div>
					</div>
				</div>
				<div ng-if="pagedata.item.status==2" class="fui-list seckill-list2" style="background:#e6e6e6;width:6rem;">
					<div class="fui-list-inner">
						<div class="text">已结束</div>
						<div class="text timer" style="height:auto;font-size:0.5rem;color:#999">
							<span class="time-day" style="width:.9rem;padding-right:0.1rem;background:#686868">{{pagedata.item.rest_time.day}}</span> 天
							<span class="time-hour" style="background:#686868">{{pagedata.item.rest_time.hour}}</span> :
							<span class="time-min" style="background:#686868">{{pagedata.item.rest_time.minute}}</span> :
							<span class="time-sec" style="background:#686868">{{pagedata.item.rest_time.second}}</span>
						</div>
					</div>
				</div>
			</div>
			<div class="fui-cell-group radiusbottom" style="margin-top:0;padding-bottom:8px">
				<div class="fui-cell" style='padding-bottom:0.2rem'>
					<div class="fui-cell-info">
						<div class="name bold" style="font-size:0.8rem">
								{{pagedata.item.title}}
						</div>
						<div ng-if="pagedata.item.isdiygoods==1" class="subtitle">
							<span class="label label-info">{{pagedata.item.sendtypetitle}}</span>
						</div>
						<div class="subtitle" style="font-size:0.6rem;margin-top:0.3rem">
								<i class="icon icon-hot red" style="color:#fb2f30"></i> 浏览 {{pagedata.item.looks}} | 分享{{pagedata.item.likes}}  | 订单{{pagedata.lognum}}
						</div>
					</div>
				</div>
			</div>
			<!--活动描述-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">活动描述</div>
				</div>
				<div class="fui-cell" style="padding-top:0.3rem;">
					<div class="content-block content-images">
					<div ng-repeat="c in pagedata.item.content">
						<p ng-if="c.type ==1" ng-bind-html="trust(c.data)"></p>
						<div ng-if="c.type ==3">
							<img ng-repeat="img in c.data track by $index" ng-click="pagedata.show_bigimage(img)" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}" style="width:100%;padding:1px">
						</div>
						<div ng-if="c.type ==10" class="fui-card-images">
							<img ng-repeat="img in c.data track by $index" ng-click="pagedata.show_bigimage(img)" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}" style="width:33.3%;height:4rem;padding:1px" />
						</div>
						<div ng-if="c.type ==11" class="fui-video">
							<video ng-src="{{tomedia(c.data)}}" poster="{{tomedia(c.thumb)}}" height="180" width="100%" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" poster="" preload="auto"></video>
						</div>
						<p ng-if="c.type ==100" ng-bind-html="trust(c.data)"></p>
					</div>
					</div>
				</div>
			</div>
			<!--活动商品-->
			<div ng-if="pagedata.item.isdiygoods==1" class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">{{pagedata.item.typename}}商品</div>
				</div>
				<div ng-repeat="g in pagedata.item.goods" class='fui-list align-start' style="padding-top:0.5rem;border-top: 1px solid #ebebeb;">
					<div class='fui-list-media' ng-click="pagedata.goods=g;pagedata.showgoods=true">
					   <img style="width: 5rem;height: 5rem;" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" />
					</div>
					<div class='fui-list-inner'>
						<div class='text bold'>{{g.title}}</div>
						<div class="fui-cellone" style="padding:0.5rem 0;">
							<div class='fui-cellone-label' style="width:auto">
							   <div class="bigprice red bold" style="font-size:1rem;position:relative">
								￥{{g.price}}
								</div>
							</div>
							<div class='fui-cellone-info' style="padding-left:0.2rem">
								<span class="arrow-left"></span><span style="display:inline-block;padding:0.1rem 0.3rem;color:#fff;font-size:0.5rem;background:#ff4e2c;border-radius:0.1rem;">{{pagedata.item.unitname || '活动'}}价</span>
							</div>
							<div class='fui-cellone-remark noremark'>
								<span ng-if="g.total" style="font-size:0.6rem;color:#666">库存{{g.lastnum}}</span>
								<span ng-if="!g.total" style="font-size:0.6rem;color:#666">库存不限</span>
							</div>
						</div>
						<div class="fui-cellone" style="padding:0;">
							<div ng-if="pagedata.item.gamename=='jy_merchgame_ms' && g.percent!=-1" class='fui-cellone-info'>
							<span class="progress" style="float: left;margin-top:0.35rem;margin-bottom:0.25rem;width: 4.5rem;height: 0.5rem;border-radius: .5rem;overflow: hidden;">
								<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: {{g.percent || 1}}%;background-color:red;"><span class="sr-only">60% Complete</span></div>
							</span>
							<span class="process-text" style="float: left;font-size:0.55rem;margin:0.3rem;">已秒 {{g.percent || 0}}%</span>
							</div>
							<div ng-if="pagedata.item.gamename=='jy_merchgame_fx'" class='fui-cellone-info' style="height:1.3rem">
							<span class="btn01">赚佣金</span>
							<span class="btn02">￥{{g.fxfee01 || '0.00'}}</span>
							</div>
							<div ng-if="pagedata.item.gamename=='jy_merchgame_pt'" class='fui-cellone-info' style="height:1.3rem">
							<span class="btn01">{{pagedata.item.gameset.teamnum || 0}}人起拼</span>
							<span class="btn02">不限制上限</span>
							</div>
							<div ng-if="pagedata.item.gamename=='jy_merchgame_bm'" class='fui-cellone-info' style="height:1.3rem">
							<span class="btn01">帮卖赚</span>
							<span class="btn02">￥{{g.bmfee || '0.00'}}</span>
							</div>
						</div>
						<div class="fui-cellone" style="padding:0;">
							<div class='fui-cellone-info' ng-if="g.buynum>0">
								<span class="label label-info">限购</span> <span style="font-size:0.6rem;color:#666">每人最多买{{g.buynum}}件</span>
							</div>
							<div class='fui-cellone-info' ng-if="!g.buynum || g.buynum==0">
								<span class="label label-info">不限购</span> <span style="font-size:0.6rem;color:#666">每人可买多件</span>
							</div>
							<div ng-if="pagedata.item.status==2" class='fui-cellone-remark noremark'>
								<span class="btn btn-sm btn-gray" style="color:#fff">已结束</span>
							</div>
							<div ng-if="pagedata.item.status!=2" class='fui-cellone-remark noremark'>
								<div ng-if="pagedata.item.status!=2" class="fui-number small">
										<div ng-if="g.cartnum>0" class="minus" ng-click="pagedata.minus($index)"><i class="icon icon-subtract" style="font-size:0.7rem"></i></div>
										<input ng-if="g.cartnum>0" class="num shownum" type="text" ng-model="g.cartnum" style="width:1rem" ng-change="pagedata.refresh()"/>
										<div class="plus" ng-click="pagedata.plus($index)"><i class="icon icon-tianjia" style="font-size:0.7rem"></i></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div ng-if="pagedata.item.isdiyform==1" class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">{{pagedata.item.unitname}}表单</div>
				</div>
				<div ng-include="sys_html('common/_diyform')"></div>
			</div>
			<div ng-if="pagedata.item.isdiyform==1" href='javascript:;' ng-click="pagedata.diyfrompost();" class='btn btn-success block' style="margin-top:0.5rem 0;border-radius:1rem">提交</div>
			<!--成交记录-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">{{pagedata.item.unitname}}记录<span style="font-size:0.6rem;color:#666">（{{pagedata.lognum || 0}}）</span></div>
				</div>
				<div ng-repeat="m in pagedata.logs" ng-if="pagedata.item.share_set!=1 && pagedata.item.fansinfo_set!=1" class="fui-cell" style="border-top: 1px solid #ebebeb;">
					<div class="fui-cell-label bold" style="width:auto">{{pagedata.lognum-$index}}.</div>
					<div class="fui-cell-text">
						<div class="fui-cellone" style="padding:0;">
							<div class='fui-cellone-label' style="width:auto;margin-right:0.3rem">
								<img style="width: 1.6rem;height: 1.6rem;border-radius:50%;" ng-src="{{tomedia(m.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
							</div>
							<div class='fui-cellone-text'>
								<div class="text bold" style="font-size:0.65rem">{{m.member.nickname || '昵称'}} <div class="gray" style="font-size:0.55rem">{{m.days || '1天前'}}</div></div>
								<div class="gray" style="font-size:0.55rem">{{m.goods[0].title || '商品名称'}}</div>
							</div>
						</div>
					</div>
					<div class='fui-cellone-remark noremark'>
						<div class="c" style="font-size:0.65rem;width:1.4rem;background:#ffe5f0;color:#d06764;padding:0.2rem;border-radius:50%;border: 1px solid #d06764;">+1</div>
					</div>
				</div>
				<div ng-if="pagedata.item.share_set==1 || pagedata.item.fansinfo_set==1" class="c" style="width:auto;padding-bottom:0.5rem">发布者已隐藏参与记录*****</div>
			</div>
			<!--评论-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-label bold" style="width:auto;color:#333;margin-right:0.3rem;font-size:0.75rem">评论 <span style="color:#666;margin-left:0.2rem">|</span></div>
					<div class="fui-cell-info">
						<div class="msg-input" ng-click="pagedata.setmsg();">
							<input type="search" placeholder="已有{{pagedata.msgnum || 0}}条留言，快来说说您的感想吧！" class="search" style="text-align: left; background:#f9f9f9" />
							<i id="searchsub" class="icon icon-bianji"></i>
						</div>
					</div>
				</div>
				<div ng-repeat="m in pagedata.list" class="fui-cell" style="border-top: 1px solid #ebebeb;">
					<div class='fui-cellone-label' style="width:auto;margin-right:0.3rem">
						<img style="width: 2rem;height:2rem;border-radius:50%;" ng-src="{{tomedia(m.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
					</div>
					<div class='fui-cellone-text'>
						<div class="text bold" style="font-size:0.65rem;color:#5c5c5c">{{m.member.nickname || '昵称'}}</div>
						<div class="text" style="font-size:0.65rem">{{m.title || '留言内容'}}</div>
						<div class="gray" style="font-size:0.55rem">{{m.days || '1天前'}}</div>
					</div>
				</div>
			</div>
			<div ng-include="sys_html('common/_copyright',true)"></div>
		</div>
		<div class="fui-navbar-tip" style="color:#fff;bottom:3rem;background:none;">
			<div class="bold" style="font-size:0.55rem;line-height:1.4rem;margin:auto;width:5rem; background-color:rgba(0,0,0,0.5);border-radius:1rem;">{{pagedata.item.ismy==1?'去分享':'去参与'}}<i class="icon icon-moreunfold" style="font-size:0.55rem;"></i></div>
		</div>
		 <div ng-if="pagedata.item.ismy==1" class="fui-navbar" style="background:#fff;">
				<div class="nav-item" href="javascript:" ng-click="pagedata.showmore=true">
					<span class="icon icon-viewgallery"></span>
					<span class="label">更多</span>
				</div>
				<div class="nav-item" href="javascript:" ng-click="access_json('jy_quanhuo/itemorder//pid='+pagedata.item.id)">
					<span class="icon icon-fenlei2"></span>
					<span class="label">{{pagedata.item.isdiyform==1?'参与':'订单'}}管理</span>
				</div>
				<div ng-if="pagedata.item.isdiygoods==1" class="nav-item">
					<span style="font-size:0.5rem">成交</span><span class="red">￥{{pagedata.item.totalprice || '0.00'}}</span>
					<span class="label">{{pagedata.lognum||0}}人来过</span>
				</div>
				<div class="nav-item cartbtn" href="javascript:" onclick="$('#showsharecover').modal();">
				<div class="btn btn-success" style="border-radius:1rem;width:5rem;margin:0">
					分享
				</div>
				</div>
		  </div>
		  <div ng-if="pagedata.item.ismy!=1" class="fui-navbar" style="background:#fff;">
				<div class="nav-item" href="javascript:" ng-click="pagedata.showmore=true">
					<span class="icon icon-viewgallery"></span>
					<span class="label">更多</span>
				</div>
				<div class="nav-item" href="javascript:" onclick="$('#showsharecover').modal();">
					<span class="icon icon-fenxiang2"></span>
					<span class="label">分享</span>
				</div>
				<div ng-if="pagedata.item.isdiygoods==1" class="nav-item">
					<span class="red">￥{{pagedata.totalprice || '0.00'}}</span>
					<span class="label">{{pagedata.cartnum||0}}个商品</span>
				</div>
				<div ng-if="pagedata.item.isdiygoods==1" class="nav-item cartbtn">
				<div class="btn btn-success" ng-click="pagedata.check_buy();" style="border-radius:1rem;width:5rem;margin:0">
					参与
				</div>
				</div>
		  </div>
	</div>
</div>
<div ng-if="pagedata.showmore" class="popup">
	<div class="popup-body">
		<div class="popup-bottom" style="background:#f2f2f2;min-height:auto">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showmore=false"></i>
			<div class="fui-icon-group noborder col-5" style="padding:0.5rem">
				<div class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/index/')">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-shouye" style="font-size:1rem;color:#F60"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">首页</div>
				</div>
				<div ng-if="pagedata.item.ismy==1" class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/merch/')">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-dianpu" style="font-size:1rem;color:#63BE72"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">我的店铺</div>
				</div>
				<div ng-if="pagedata.item.ismy==1" class="fui-icon-col-sm external" style="margin:0" ng-click="pagedata.check_buy();">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-lvyoutehui" style="font-size:1rem;color:#999"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">{{pagedata.is_xuni==1?'虚拟参与':'自己参与'}}</div>
				</div>
				<div ng-if="pagedata.item.ismy!=1" class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/order/')">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-fenlei2" style="font-size:1rem;color:#63BE72"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">我的订单</div>
				</div>
			</div>
			<div class="fui-icon-group noborder col-5" style="padding:0.5rem">
				<div ng-if="pagedata.item.ismy==1" class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/upitem//id='+pagedata.item.id)">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-bianji" style="font-size:1rem;color:#999"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">修改活动</div>
				</div>
				<div ng-if="pagedata.item.ismy==1" class="fui-icon-col-sm external" style="margin:0" ng-click="post({},'jy_quanhuo/item/setend/id='+pagedata.item.id);">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-dianpu" style="font-size:1rem;color:#999"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">结束活动</div>
				</div>
				<div class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/upitem//iscopy=1&id='+pagedata.item.id)">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-copy" style="font-size:1rem;color:#999"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">复制活动</div>
				</div>
				<div class="fui-icon-col-sm external" style="margin:0" ng-click="access_json('jy_quanhuo/addgame/')">
					<div class="c radius" style="background:#fff;width:2.5rem;height:2.5rem;line-height:2.8rem;margin:auto">
						<i class="icon icon-tianjialeimu" style="font-size:1rem;color:#999"></i>
					</div>
					<div class="text" style="font-size:0.65rem;color: #666;margin-top:0.3rem">发个活动</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('common/_goodsitem')"></div>
<div ng-include="sys_html('common/_setmsg')"></div>
<div ng-include="sys_html('common/_share','','','jy_weishop')"></div>
<div ng-include="sys_html('common/_gotop',true)"></div>
<!--弹目-->
<div ng-if="pagedata.showtanmus" class="video-sms-pane {{pagedata.transition?'transition':''}}">
		<div class="video-sms-text">
			<image class="video-sms-logo" ng-src="{{pagedata.tanmus[pagedata.nowmsgid].avatar}}"/>
			<span class="overflow-h"> {{pagedata.tanmus[pagedata.nowmsgid].nickname}} 进入了活动</span>
		</div>
</div>
<script>
scope.pagedata.getlog=function(){
	scope.get('jy_quanhuo/item/getlog/pid='+scope.pagedata.item.id,function(res){
		scope.pagedata.logs=res.list;
		scope.$evalAsync();
	});
}
scope.pagedata.getlog();
scope.tool.get_list('jy_quanhuo/item/getmsg/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_quanhuo/item/getmsg/');
}
scope.pagedata.gettanmus=function() {
	if(!scope.pagedata.issocketmsg){
			scope.pagedata.nowmsgid=0;
			scope.get('jy_quanhuo/get_data/gettanmus/page='+scope.pagedata.tanmuspage,function(res){
						//console.log(res);
						scope.pagedata.tanmus=res.list
						if(scope.pagedata.tanmus.length>0){
							scope.pagedata.tanmuspage++;
							scope.pagedata.up_oldtanmu();
						}
			});
	}
}
setTimeout(function(){
	if(scope.page.action=='item'){
		scope.pagedata.gettanmus();
	}
},2000);
scope.pagedata.up_oldtanmu=function() {
		if(scope.page.action=='item'){
			var i=scope.pagedata.nowmsgid;
			if(i<scope.pagedata.tanmus.length){
				set_tanmu(scope.pagedata.tanmus[i].nickname,scope.pagedata.tanmus[i].avatar,scope.pagedata.tanmus[i].time);
			}else{
				scope.pagedata.gettanmus();
			}
		}else{
			return false;
		}
}
function set_tanmu(nickname,avatar,time) {
		scope.pagedata.nowmsgid++
		scope.pagedata.showtanmus=true
		scope.$evalAsync(scope.pagedata.showtanmus);
		setTimeout(function(){
			scope.pagedata.transition=true
			scope.$evalAsync(scope.pagedata.transition);	
		},300);
		setTimeout(function(){
			scope.pagedata.showtanmus=false
			scope.pagedata.transition=false
			scope.$evalAsync(scope.pagedata.showtanmus);	
		},2000);
		setTimeout(function(){
			//等待5秒，如果没有新的订单消息，就弹储备订单消息
			scope.pagedata.issocketmsg=scope.pagedata.issocketmsg?scope.pagedata.issocketmsg:false;
			if(!scope.pagedata.issocketmsg && scope.page.action=='index'){
				scope.pagedata.up_oldtanmu();
			}
		},4000);
}
scope.pagedata.check_buy=function(){
	scope.post_json('jy_quanhuo/item/check_buy/',scope.pagedata.item);
}
</script>
<script>
//提交留言
scope.pagedata.setmsg=function(){
	$('#showremark').modal();
}
//刷新总数和总价
scope.pagedata.refresh=function(){
	var goods = scope.pagedata.item.goods;
	var totalprice=0;
	var cartnum=0;
	for(var i=0;i<goods.length;i++){
		if(goods[i].cartnum>0){
			totalprice +=goods[i].price*goods[i].cartnum;
			cartnum +=goods[i].cartnum;
		}
	}
	scope.pagedata.totalprice=totalprice;
	scope.pagedata.cartnum=cartnum;
	scope.pagedata.showprice=scope.price(scope.pagedata.totalprice);
	scope.$evalAsync();
}
//减少
scope.pagedata.minus=function(index){
	var g = scope.pagedata.item.goods[index]
	if(g.cartnum<=0){
		return false;
	}
	g.cartnum--;
	scope.pagedata.item.goods[index]=g;
	scope.pagedata.refresh();
}
//增加
scope.pagedata.plus=function(index){
	var g = scope.pagedata.item.goods[index]
	//console.log(g);
	if(g.cartnum>=g.canbuynum && g.canbuynum){
		scope.message('不能再添加了，每人最多购买'+g.canbuynum+'件！','error');
		return false;
	}
	if(g.cartnum>=g.buynum || (g.buynum>=g.isbuynum && g.isbuynum>0)){
		scope.message('不能再添加了，已超过库存！','error');
		return false;
	}
	g.cartnum++;
	scope.pagedata.item.goods[index]=g;
	scope.pagedata.refresh();
}
//获取关注
scope.pagedata.setlike=function(){
	scope.post_json('jy_quanhuo/index/shoucang/',{'pid':scope.pagedata.item.id},function(res){
		scope.message(res);
	});
}
</script>